<template>
  <j-modal
    title="通知公告"
    :visible="visible"
    :footer="null"
    ok-text=""
    :destroyOnClose="true"
    :fullscreen="true"
    @close="
      () => {
        visible = false
      }
    "
  >
    <div style="width: 100%">
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <!-- <a-icon type="vertical-align-bottom" @click="handleDownloadFile(record.url)"></a-icon> -->
          <a @click="handleToDetail(record)">查看</a>
        </span>
      </a-table>
    </div>
  </j-modal>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  name: 'todoModel',
  components: {},
  mixins: [JeecgListMixin],
  data() {
    return {
      visible: false,
      columns: [
        {
          title: '序号',
          dataIndex: '序号',
          width: 70,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '标题',
          dataIndex: 'titile'
        },
        {
          title: '创建人',
          dataIndex: 'sender',
          width: 300
        },
        {
          title: '发送时间',
          dataIndex: 'updateTime',
          width: 300
        },
        {
          title: '操作',
          align: 'center',
          width: 150,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/sys/annountCement/list?sendStatus=1'
      }
    }
  },
  methods: {
    handleToDetail(record) {
      this.$router.push({
        name: 'isystem-annountCement',
        query: { titile: record.titile }
      })
      this.visible = false
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>